package test;

/*
 * Author: JacksonCoder
 * FileName: test
 * Version: 1.0.0
 * Date: 2025/5/9
 */

import java.util.Arrays;

public class test {
    public static void main(String[] args) {

        int a = 0;
        int b = 1;
        int[] nums = {1, 8, 6, 2, 5, 4, 8, 3, 7};
        int left = 0;
        int right = nums.length - 1;
        int maxArea = 0;
        while (left < right) {
            int Area = (right - left) * Math.min(nums[left], nums[right]);
            maxArea = Math.max(maxArea, Area);
            if (nums[left] < nums[right]) {
                left++;
            } else {
                right--;
            }
        }
        System.out.println("最大的面积为: " + maxArea);

        int minNum = Math.min(a, b);
        System.out.println(minNum);

        int[] arrays = {1,7,-1,0 ,6,-4,8,-7};

        printThree(arrays);
    }

    public static void printThree(int[] nums){
        // 排序
//        int[] arrays =  Arrays.sort(nums);

//        int[] sortedArray = Arrays.stream(nums).mapToInt(Integer::intValue).toArray();
//        System.out.println("nums :" + arrays);
    }
}
